/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 * Description: libata driver Vendor Hooks
 */

#ifdef CONFIG_NETBIOS_LIBATA_SPEC

#ifndef LIB_ATA_EXT_H
#define LIB_ATA_EXT_H
#include "libata.h"

void trace_libata_eh_notfier(struct ata_link *link, ata_reset_fn_t reset,
							ata_reset_fn_t hardreset);
void trace_libata_record_ncq_fpdma_err(struct ata_queued_cmd *qc);
void trace_libata_deal_ncq_fpdma_err(struct ata_link *link);
void trace_libata_cf_err_init(void);
void trace_libata_set_cf_err_flag(unsigned long flag);
#endif

#else

struct ata_port;
struct ahci_port_priv;
#define TP_PROTO(args...)	args
#define DECLARE_ATAFUNC_NOP(name, proto, args)	\
	static inline void trace_##name(proto)		\
	{ }

DECLARE_ATAFUNC_NOP(libata_eh_notfier,
	TP_PROTO(struct ata_link *link, ata_reset_fn_t reset, ata_reset_fn_t hardreset),
	TP_ARGS(link, reset, hardreset));

DECLARE_ATAFUNC_NOP(libata_record_ncq_fpdma_err,
	TP_PROTO(struct ata_queued_cmd *qc),
	TP_ARGS(qc));

DECLARE_ATAFUNC_NOP(libata_deal_ncq_fpdma_err,
	TP_PROTO(struct ata_link *link),
	TP_ARGS(link));

DECLARE_ATAFUNC_NOP(libata_cf_err_init,
	TP_PROTO(void),
	TP_ARGS());

DECLARE_ATAFUNC_NOP(libata_set_cf_err_flag,
	TP_PROTO(unsigned long flag),
	TP_ARGS(flag));
#endif
